package com.cloneoner.utils
{
	/**
	 * @author Thibault Loup
	 */
	public class ClStringutil
	{

		public static function multiReplace(pString : String, pArrayPattern : Array, pArrayReplace : Array) : String
		{
			var st : String = pString;
			var sp : String, sr : String, reg : RegExp;

			while ( sp = pArrayPattern.shift() )
			{
				sr = pArrayReplace.shift();
				reg = new RegExp(sp, "gi");
				st = st.replace(reg, sr);
			}

			return st;
		}
	}
}
